package PlaneTest;
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
//游戏主窗口
public class MyGameFrameCS extends Frame {
    Image plane = GameUtil.ImageGame("images/FJ.png");
    Image bg = GameUtil.ImageGame("images/BJ.jpg");
    static int count =0;
    int planex = 100;


    @Override
    public void paint(Graphics g) {//g当作一支画笔

        g.drawImage(bg,0,0, 1000,700,null);
        g.drawImage(plane,planex,100,25,25,null);
        planex += 1;
    }

    //初始化窗口
    public void launchFrame(){
        this.setTitle("是男人你就坚持20秒");
        setVisible(true);//窗口默认可见
        setSize(1000,700);//设置窗口大小
        setLocation(400,400);//窗口打开的位置
        //增加关闭窗口操作
        this.addWindowListener(new WindowAdapter() {
            @Override
            public void windowClosing(WindowEvent e) {
                System.exit(0);//正常退出
            }
        });


    }



    public static void main(String[] args) {
        MyGameFrameCS gameFrame = new MyGameFrameCS();
        gameFrame.launchFrame();
    }

}
